DIAMONDINHERITANCE := diamondInheritance.cc
DIAMONDINHERITANCE_BASE := $(basename $(DIAMONDINHERITANCE))

NOINHERIT := noInherit.cc
NOINHERIT_BASE := $(basename $(NOINHERIT))

REWRITE := rewrite.cc
REWRITE_BASE := $(basename $(REWRITE))

PRINTVIRTUALTABLE := printVirtualTable.cc
PRINTVIRTUALTABLE_BASE := $(basename $(PRINTVIRTUALTABLE))

CALLER := caller.cc
CALLER_BASE := $(basename $(CALLER))

.PHONY:debug
debug:
	@echo $(DIAMONDINHERITANCE_BASE)
	@echo $(NOINHERIT_BASE)
	@echo $(REWRITE_BASE)
	@echo $(PRINTVIRTUALTABLE_BASE)
	@echo $(CALLER_BASE)

$(DIAMONDINHERITANCE_BASE):$(DIAMONDINHERITANCE)
	@g++ -o $@ $< -std=c++11
$(NOINHERIT_BASE):$(NOINHERIT)
	@g++ -o $@ $< -std=c++11
$(REWRITE_BASE):$(REWRITE)
	@g++ -o $@ $< -std=c++11
$(PRINTVIRTUALTABLE_BASE):$(PRINTVIRTUALTABLE)
	@g++ -o $@ $< -std=c++11 -g -lstdc++
$(CALLER_BASE):$(CALLER)
	@g++ -o $@ $< -std=c++11 -g -lstdc++


.PHONY:compile
compile:$(DIAMONDINHERITANCE_BASE) $(NOINHERIT_BASE) $(REWRITE_BASE) $(PRINTVIRTUALTABLE_BASE) $(CALLER_BASE)

.PHONY:clean	
clean:
	@rm -f $(DIAMONDINHERITANCE_BASE) $(NOINHERIT_BASE) $(REWRITE_BASE) $(PRINTVIRTUALTABLE_BASE) $(CALLER_BASE)
